home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_061 / microemacs / emacs1.mss < prev    next >
Text File  |  1992-05-06  |  50KB  |  1,032 lines

  1. @chapter(INTRODUCTON)
  2.  
  3.      MicroEMACS, henceforth called EMACS, is a full screen editor (not a
  4. word processor) which is available on a variety of computers (both micro
  5. and mini/main frame).  As a general characteristic, EMACS is a function
  6. driven program wherein every keystroke is a "function" call; hence,
  7. there is no notion of input versus edit modes.  Thus, for example, the
  8. keystroke 'a' invokes the function "insert-character 'a'".  All visible
  9. ASCII (8-bit) characters are self-inserting while the non-visible
  10. (control) characters are used as commands. 
  11.  
  12. There is a tutorial file called emacs.tut on the distribution disk. 
  13. It might be useful if you read this documentation after going through
  14. the tutorial.  To do this, type @b<emacs emacs.tut> when you get the DOS prompt.
  15. This will start emacs, instructing it to read in the file emacs.tut
  16. from the default disk into a standard buffer and put you into it.  You
  17. can then follow the instructions in it.  @i<In case of trouble, you
  18. can always abort a command with CTRL-G or abort emacs with CTRL-X CTRL-C.>
  19.  
  20.      The command structure of EMACS is simple: commands are
  21. single keystroke, double keystroke, or full command-spec. For
  22. efficiency, single keystroke commands are the most used, followed
  23. by 2-keystroke, and so on.
  24.  
  25.     Every command (where it makes sense) in EMACS allows for a numeric
  26. argument in pre-fix notation.  Since decimal digits are also
  27. self-inserting, arguments are passed to the command (including
  28. self-insert commands) through two mechanisms.  First, an arbitrary
  29. numeric argument can be passed by ESC <number> where <number> is a
  30. standard decimal number and ESC is the ESCape character (control-[ or
  31. the ESC on your keyboard).  Thus, the sequence "esc 7 a" results in
  32. aaaaaaaa.  Second, numeric arguments of powers of 4 can be passed by
  33. prefixing a command with control-U's.  Each control-U increases the
  34. power by 1.  Hence control-U means 4, control-Ucontrol-U means 16,
  35. control-Ucontrol-Ucontrol-U means 64 and so on.  Thus,
  36. "control-Ucontrol-Ua" yields:aaaaaaaaaaaaaaaa.  If an explicit numeric
  37. argument is not given, EMACS uses 1.  Note also that negative numeric
  38. arguments can also be given and EMACS tries to behave intelligently
  39. about them. 
  40.  
  41.      The structure of this document is functional: i.e., each
  42. section is devoted to a set of common activities such as moving
  43. around, deleting, copying etc.
  44. @chapter(PRELIMINARIES)
  45. @section(REGION or POINT and MARK)
  46.  
  47.      A region is a block of text to be acted upon by some EMACS
  48. commands.  It is demarcated by the POINT on one end and the MARK at
  49. the other.  The point is the primary location identifier where most
  50. of the action takes place and is always @i(between) two characters. 
  51. The point is indicated by the cursor position in that it is just
  52. behind the cursor.  The point is also significant in that it defines
  53. one end of the region.  The mark, on the other hand, is invisible,
  54. and is used to demarcate the other end of the region( see section
  55. @ref(regmov) or, to peek ahead, one denotes the mark by escape .). 
  56.  
  57. @section(BUFFERS)
  58.  
  59.      Buffers are regions of memory which are the primary units internal
  60. to EMACS and where EMACS does its work. Thus, a file being edited
  61. is located in a buffer. One can have multiple buffers, each with
  62. a unique name, each of which can contain a file to be worked
  63. upon.  The KILL buffer is a very special buffer that is always around
  64. and which holds large pieces of deleted text.  While you cannot
  65. directly work with the buffer, you use it indirectly in copying/moving
  66. text segments.
  67.  
  68. @section(MODE)
  69.  
  70.      An EMACS mode specifies the general fashion in which EMACS
  71. deals with user input.  For example, how should EMACS deal with long
  72. lines (> 79 characters)? The mode is associated with the buffer and
  73. not the file.  Hence, the mode has to be explicitly set (or removed)
  74. each time the file is to be edited.  However, since the mode is
  75. associated with the buffer, a new file read into the buffer will be
  76. edited with the previously specified mode.  Also, standard (default)
  77. modes can be set for all buffers when EMACS is first started.  (See
  78. @ref(modes) for more information of modes.)
  79.  
  80. @section(WINDOWS)
  81.  
  82.      Windows are the visible portions of buffers. EMACS allows as
  83. many windows on the screen as can fit. Since windows are screen
  84. objects, the relationship of windows to buffers can be
  85. many-to-one. That is, one can have many windows per buffer or a
  86. each window could be into a different buffer.
  87.  
  88. @section(SCREEN)
  89.  
  90.      The screen is usually the 24 row by 80 column section of the
  91. physical screen that is available to EMACS.  The format is as
  92. follows.  The 24th row (the bottom line) is generally clear.  It is
  93. used for EMACS prompts, user responses, and EMACS messages.  The
  94. remainder of the screen (23 rows) is left for text display.  For
  95. each window that is open on the screen, the bottom line is used to
  96. provide information to the user.  Starting with the program's name
  97. and version number, it contains the buffer mode(s) in parenthesis,
  98. the buffer name and, finally, the file name associated with theref
  99. buffer if there is one so associated. 
  100.  
  101. @section(OBJECTS)
  102.  
  103.      Objects are the entities upon which commands will operate. The most
  104. common object is the character. Other objects are: words, lines, sentences,
  105. paragraphs, screens, regions, and files.
  106.  
  107. @section(NOTATION)
  108.  
  109.       Standard visible characters are shown normally.  Control charactes
  110. (the so-called non-printing characters) are shown prefixed by a @b(^)
  111. e.g., control-A as ^A.  NOTE: in 8-bit ASCII there are 32 non-printing
  112. characters: @center<^@ ^A..^Z ^[ ^\ ^] ^^ ^_>
  113.  
  114.     Control characters are case independent; i.e., ^A is the same as
  115. ^a.  Further, the escape key which, technically, is ^[ is denoted by
  116. ESC; most keyboards have a special key marked ESC.  In two-keystroke
  117. commands, the intervening blank space shown is for clarity and should
  118. not be typed.  Parameters to be supplied by you are indicated as
  119. [parameter-type].  Finally, special keys are denoted by <key-name>. 
  120.  
  121. @section(GETTING STARTED)
  122.  
  123.     To start using EMACS, just type @b(EMACS [filename]) (where
  124. [filename] is the name of the file you wish to edit) from your operating
  125. system's command prompt.  This will bring up EMACS and read in the file
  126. you wish to edit.  (@i[If you are using EMACS for the first time one
  127. your machine, read @ref<install> to learn how to install EMACS on your
  128. machine]).
  129.  
  130. @chapter(INSERTING TEXT)
  131.  
  132.     All standard "printable" ASCII characters are self-inserting.  This
  133. means for those of you who have "extended" characters (ASCII 128-255)
  134. you can type these in just as you any other character.  For example, on
  135. the IBM-PC, keeping the <Alt> key pressed down while typing in another
  136. key sequence will give you the "extended" character.  With the following
  137. exceptions, all other non-printing characters are commands:
  138.  
  139. @begin(description)
  140. ^I (or <TAB>)@/Handle-Tab: inserts the tab character or  spaces
  141. to move the currently set tab distance (see @ref(tabset)).  When you first
  142. start EMACS, this character inserts itself and while you "see" spaces,
  143. there is just one character there.  However, if you use the set-tab
  144. distance command (by ESC [number] ^I) then the required tab distance is
  145. obtained by inserting the requisite number of spaces and @i(now) the
  146. spaces that you see are indeed spaces.
  147.  
  148. ^M (or <RETURN>)@/Insert-Newline.  insert a new-line
  149. at point.  Note that this is a    
  150. character like any other and can be deleted or inserted at any place.  However
  151. it looks different because it acts like the carriage-return line
  152. feed pair.
  153.  
  154. ^J (or <LINEFEED>)@/NewLine-Indent: like above but indent to previous
  155. line's indentation
  156. Hence, a ^J actually inserts a new-line and as many spaces as
  157. required to move under the first character on the previous line.
  158.  
  159. ^O (oh)@/Open-Line: insert an open line at cursor for entering text.
  160. This is a
  161. very useful command when you are going to be inserting more than a few
  162. characters in between existing characters.  By using ^O you will not
  163. be forcing EMACS to shift other text around as you type and things
  164. will both go faster and look cleaner on the screen.  If you are going
  165. to insert a lot of new text, use a numeric argument to get a lot of
  166. blank lines after point.  You can use ^X ^O to clean up the
  167. buffer after you finish adding your text (see @ref(deblank)).
  168.  
  169. ^Q@/Quote-Next-Character.  If you wish certain control characters (non-printing) to
  170. appear in your text, you can do so by "quoting" them with a ^Q. Hence
  171. the sequence:  ^Q [char] will insert the [char] into the text.
  172.  
  173. ^C@/Insert-Space.  This command inserts a space after point. 
  174. While not particularly useful in general (since the space-bar "key" does
  175. the same thing and more easily) it is very useful when you are in "insert
  176. mode (see @ref(insertmode)).
  177. @end(description) 
  178. @chapter(MOVING AROUND)
  179.  
  180.      In this chapter, we cover ways of moving around in a variety
  181. of contexts: the screen, region, and file.
  182.  
  183. @section(SCREEN)
  184.  
  185.      Movement commands work on pieces of text called objects.  Three objects
  186. are involved in moving around the screen: character, word and paragraph.
  187. @subsection(Character Moving)
  188. @begin(description) 
  189. ^F@/Forward-Charcter.  The point moves forward by one character 
  190. hence the cursor also moves since the cursor is just after point.  Again
  191. note that since the new-line character is a character, you can "move"
  192. over it just as you would any other character.  On the screen this
  193. appears as a jump to the beginning of the next line.
  194.  
  195. ^B@/Backward-Character.  Just like Forward-Character but in the reverse
  196. direction.
  197. @end(description)@subsection(Line Moving)@begin(description)
  198. ^P@/Previous-Line.  The point moves to the same column in the
  199. previous line if that is possible.  If there is no text for it to move to
  200. it moves to the end of the line.  However, it "remembers" the column
  201. it was in and moves to it when you return to the starting line.  If
  202. the point is on the top line of the screen, the screen scrolls
  203. backward so that the previous line of the text is centered on the new screen.
  204.  
  205. ^N@/Next-Line.  Like ^P but point moves to the next line.
  206.  
  207. ^E@/End-Of-Line.   The point moves after the last character
  208. on the line and stays between it and the <new-line> character.  Hence
  209. another ^F (Forward-Character) would put you past the new-line, i.e.,
  210. at the beginning of the next line.
  211.  
  212. ^A@/Start-Of-Line.  The point moves to the
  213. beginning of the line and is between the first character on the line
  214. and the new-line character of the previous line.  A ^B (or
  215. Backward-Character), then, would put you at the end of the previous line.
  216.  
  217. ESC G@/To-Numbered-Line.  The cursor moves to the line
  218. specifed by the numeric argument.  If none is given, EMACS, as usual,
  219. would assume 1 and move you to the top of the buffer.
  220. Use ESC <number> to denote the target line where
  221. the first line is 1.  Hence, for example, if you wished to go to
  222. the 83 line you would type ESC 83 ESC G.
  223. @end(description)
  224. @section(Word Moving)
  225. @begin(description) 
  226. ESC F@/Forward-Word.  The point is moved from its current location to the
  227. beginning of the next word.
  228. A word is defined to be contiguous characters separated by spaces or
  229. punctuation marks.  Hence if the point is currently in middle of two words
  230. (i.e., @i[in front of the space or the punctuation]) it is moved to the
  231. beginning of the next word.
  232.  
  233. ESC B@/Backward-Word.  Like forward word but in the reverse direction.
  234. @end(description)@section(Paragraph Moving)@begin(description)
  235. ESC N@/Forward-Paragraph.  Move to the beginning of the next paragraph.
  236.  
  237.     NOTE: A paragraph is defined as a section of text separated
  238. from other text by 1) blank lines, 2) a line starting with
  239. blanks, or 3) a line starting with a tab character (^I).@tag(paradef)
  240.  
  241. ESC N@/Backward-Paragraph.  Like forward-paragraph but in the reverse
  242. direction.
  243. @end(description)@section(Region Moving)@TAG(regmov)
  244. @begin(description)
  245. ^X ^X@/Exchange-Point-And-Mark.  There is only one region available at
  246. a time. Hence, moving
  247. by regions is restricted to moving from one end of the region
  248. to the other.  To reiterate, the region is defined by the point
  249. (behind the cursor) at one end and the mark (set by ESC . or ESC space)
  250. at the other. Recall that @i<this> end of the region is where the cursor is.
  251. Hence exchanging point and mark effectively moves you from one end of
  252. the region to the other.
  253. @end(description)@section<Screen Moving>@begin(description)
  254. ^V or <NEXT>@/Next-Screen.  The screen is scrolled up so that the
  255. next set of lines can be shown in the window.  EMACS retains an
  256. overlap of two lines for continuity -- i.e., you do not get a new
  257. screen starting with the first previously invisible line but rather
  258. the new screen will start with two lines from the bottom of the
  259. previous screen. The point is left at the home position (top left hand corner).
  260.  
  261. ESC V or CTRL Z or <PREV>@/Previous-Screen.  Like above except that the previous
  262. set of screen lines is displayed.
  263. @end(description)
  264. @section(Window Moving)
  265. @begin(description)
  266.  
  267. ^X O (oh)@/Next-Window.  Moves point to the
  268. the next window on the screen.  EMACS cycles through windows.  Thus, if you
  269. are in the bottom window, you are moved to the top window.
  270.  
  271. ^X P@/Previous-Window.  Like above but in the opposite direction.
  272. @end(description)
  273.  
  274. For addtional information on windows, see @ref(windows).
  275. @section(Buffer Moving)@begin(description)
  276.  
  277. ESC < or <HOME>@/Top-Of-Buffer.  Moves point to the very beginning of
  278. the buffer.
  279.  
  280. ESC >or <shift-HOME>@/Bottom-Of-Buffer.  Moves point to the very end of the buffer.
  281.  
  282. ESC B@/To-Named-Buffer.  You will be prompted for a buffer name (see
  283. @ref(buflist) on how to find out about your buffers) and will be
  284. switched to it.  If the buffer does not exits, EMACS will create one
  285. and put you into it.
  286.  
  287. ^X X@/Next-Buffer.  You will be put into the next buffer
  288. in the buffer list.  Like with windows, EMACS cycles through the
  289. buffer list and hence if you are in the last buffer, you will be put
  290. into the first one.
  291. @end(description)
  292.  
  293. For additional information on buffers, see @ref(buffers).
  294.  
  295. @section(File Moving)
  296. A file is a named collection of text and is associated with a buffer
  297. in EMACS.  EMACS allows full filenames; hence the full path can be specifed.
  298. In all cases of moving between files, you will be prompted for a filename
  299. Type it in and hit <return>.
  300. @begin(description)
  301.  
  302. ^X ^R@/Read-File.  The file, if found, is read into the
  303. current buffer overwriting any text already in it. If the buffer has
  304. been changed and you have not saved your changes, you will be asked to
  305. confirm the overwrite.  If the file is not found where specified, it
  306. is assumed that you wish to create a new file with that name and your
  307. current buffer is merely emptied.
  308.  
  309. ^X ^F@/Find-File.  EMACS attempts first to find the
  310. specified file within one of the existing buffers.  If it finds the file
  311. it merely switches you to that buffer.  If it does not, it will
  312. create a new buffer, read the specified file if found into it, and
  313. switch you to the new buffer.  If the file is not found, a new buffer
  314. is created and you will be put into it.
  315.  
  316. ^X ^V@/View-File.  Like find-a-file above except that the
  317. VIEW mode is automatically added to the buffer.  In this mode you are
  318. only allowed to move around the buffer and cannot make any changes.
  319. @end(description)
  320.  
  321. @chapter(DELETING)
  322. Like moving around, deleting is an action that can work with a variety
  323. of objects:  characters, words, lines, paragraphs, regions, windows, and
  324. buffers.  It is worth reiterating that the object is defined relative
  325. to the point and not the object as a whole.  Hence, if you are in the
  326. middle of a word and issue a delete-forward-word command, the text
  327. deleted is actually from the point to the end of the word.
  328. @section(Character)@begin(description)
  329. CTRL-D@/Delete-Forward-Character.  Since the point is always just before
  330. the cursor, the character under the cursor is deleted.  When you are
  331. at the end of a line, the point is just before the <newline>
  332. character and, therefore, a Delete-Forward-Character "eats" up the <newline> --
  333. in effect this joins the next line to the current one.
  334.  
  335. CTRL-H  or <BACKSPACE>@/Delete-Backward-Character.  This deletes the
  336. character before point.  At the beginning of a line, it deletes the
  337. previous <newline> character and hence joins the current line to the
  338. previous one.
  339. @end(description)@section(Word)@begin(description)
  340. ESC D@/Delete-Forward-Word.  Deletes the text from the point to the
  341. @i<beginning> of the next word.  Hence, any punctuation separating the
  342. words is also deleted.
  343.  
  344. ESC <backspace> or ESC CTRL-H@/Delete-Backward-Word.  Like above but
  345. in the reversse direction.
  346. @end(description)@section(Line)@begin(description)
  347. CTRL-K@/Delete-To-End-Of-Line (Kill line).  All characters from point to the end
  348. of the line are deleted.  @i[The <new-line> character is NOT deleted.]
  349.  
  350.     To delete a line completely from the buffer you would have to do the
  351. following: CTRL-A (Start-Of-Line) CTRL-K (Delete-To-End-Of-Line) CTRL-D
  352. (Delete-Forward-Character to delete the <newline> character).
  353.  
  354. @tag(delete)
  355. As with all major deletes (i.e., when more than a few characters are deleted
  356. EMACS places the deleted text in a KILLS buffer.  Hence, the deletion
  357. can be undone by "yanking" the text back at point (using CTRL-Y).
  358.  
  359. CTRL-X CTRL-O (oh)@/Delete-Blank-Lines.  This command deletes all blank
  360. @i<lines> around the current line.  If there is only blank line after the
  361. current line it is @i<not> deleted.  However, if there are more than 1
  362. blank lines after the current line, @i<all> of them are deleted.@tag(deblank)
  363. @end(description)@section(Region)
  364. The region is an arbitrary area of the buffer demarcated by the point 
  365. (just before the cursor!) and the mark. The mark is invisible and is
  366. set using ESC . or ESC <space>.  To see the other end of the region,
  367. use the Exchange-Point-And-Mark (CTRL-X XTRL-X) command.  Since the
  368. region has no direction associated with it, this effectively shows you
  369. the mark and all region commands work correctly.  Furthermore, since
  370. the region is completely arbitrary in size you could demarcate any
  371. sized object from a single character all the way to the entire buffer.
  372. @description<
  373. CTRL-W@/Delete-Region (kill World!).  Deletes the region (between
  374. point and mark) and places the killed text in the KILLS buffer to be "yanked"
  375. back (with CTRL-Y) at the point.  Hence if you ever accidentally type CTRL-W
  376. simply undo it with an immediate CTRL-Y (strictly speaking this does
  377. not have to be done immediately since the KILLS buffer is overwritten
  378. only with the next big delete).>
  379. @section<Windows>@description<
  380. CTRL-X 1 (one)@/Close-All-Other-Windows.  This will close all windows on the
  381. screen except for the one you are in (issued the command from).>
  382. @section(Buffers)@description<
  383. CTRL-X K@/Delete-Buffer.  You will be prompted for the name of a buffer
  384. If the buffer has been changed, you will be asked to confirm the
  385. deletion since killing the buffer would eliminated your changes.  To
  386. find out which buffers you have, use the CTRL-X CTRL-B command (see
  387. @tag<buflist>).  As always CTRL-G aborts the pending command -- which
  388. means @i(before) you hit return after typing in the buffer name.>
  389.  
  390. @section<Files>
  391.  
  392.      Files within EMACS are dealt with by dealing with the
  393. associated buffers. If you really want to deal with the
  394. disk based versions of files, escape to MSDOS, manage your files
  395. and return to EMACS (see @ref(msdos) for a discussion on using MSDOS from
  396. within EMACS).
  397.  
  398. @chapter(MOVING/COPYING TEXT)
  399.  
  400.  
  401.      Transposing single characters is easy in EMACS.  CTRL-T does it. 
  402. Larger entities are dealt with via the KILLS buffer (see
  403. @ref(delete)).  Moving or copying text in EMACS is fundamentally
  404. identical.  The general procedure is as follows:
  405. @begin(enumerate) 
  406.  
  407. If pre-defined areas of text are the desired areas to move or copy use
  408. the appropriate delete command (delete-line,  delete para etc.) to get
  409. a copy of the area into the KILLS buffer.  An immediate "yank" (CTRL-Y)
  410. results in an unchanged buffer.
  411.  
  412. If arbitrary areas of text are desired, the region is used.
  413. Demarcate the region to be moved/copied (to repeat:
  414. at one end of the region use the set-mark command (with ESC .
  415. or ESC <space>) and move the cursor to the other end.  Delete (CTRL-W for
  416. move) or copy (ESC W) the region into the KILLS buffer.
  417.  
  418. Once the desired text is in the KILLS buffer, it can be inserted into
  419. @i(any) buffer by moving the point into the desired buffer at the desired
  420. location and "yanking" (CTRL-Y) the text from the KILLS buffer.
  421. @end(enumerate)@begin(description)
  422. CTRL-W@/Kill-Region.  Delete text between point and mark and copy it
  423. into the KILLS buffer.
  424.  
  425. ESC W@/Copy-Region.  Copy text between point and mark into the KILLS buffer.
  426.  
  427. CTRL-Y@/Yank-Text.  Insert a copy of the KILLS buffer into current
  428. buffer at point.  @i<If you accidently typed CTRL-W (the kill region command),
  429. immediately recover by typing in CTRL-Y (the yank text command).>
  430. @end(description)
  431.  
  432. Since the KILLS buffer is an independent buffer, you can move text
  433. between @i<files> by moving text between @i<buffers>.  Further, "yanking"
  434. is a read-only operation; hence the text can be inserted as many
  435. times as desired with repeated yanks.  However,  the KILLS buffer gets
  436. overwritten with each major delete (i.e., deletion of more than a few
  437. characters at a time).  Consequently you cannot (as yet) accumulate
  438. text in the KILLS buffer with a sequence of kills.  If you need to
  439. accumulate text use a regular buffer (one that you ask for, see @ref(buffers))
  440. to hold copies of the deleted (or copied) text.  If you are doing a
  441. lot of accumulation, you might want to use a keyboard macro (see
  442. @ref(kbdmacro)).
  443. @chapter(SEARCH/REPLACE)
  444.  
  445. Searching and replacing occurs from the current cursor
  446. position towards the end of the buffers. 
  447. When either (forward or backward) search type is asked for, you will be
  448. prompted for the search string on the prompt line. Type in the string
  449. (including carraige returns, control characters etc.) and finish
  450. by hitting the ESC key which marks the end of the string.
  451. Unfortunately, this means that ESC itself cannot be part of the
  452. string.  The seach behaviour of EMACS depends upon the setting of the
  453. exact mode of the buffer (see @ref(buffers) for details on modes).  If
  454. exact mode is on, then the search is done on a case sensitive basis. 
  455. Otherwise, the case of the target is ignored.  Note that the default
  456. for every buffer is for the exact mode to be off (unless the global
  457. mode is set to have exact on for each buffer, see @ref(globalmode). 
  458. Obviously, no such constraint exists for the replacement string since
  459. the replacement is @i<always> exact.
  460. EMACS remembers the search and replace strings and
  461. always shows you the current stored string when it prompts you for a
  462. string .  This string is used if you respond to the prompt with a null
  463. string (i.e., if you simply hit ESC when prompted).
  464.  
  465. There are two ways to replace strings in EMACS: unconditional or query
  466. replace.  In the first, EMACS moves from point to the end of the buffer
  467. replacing @i<every> occurrence of the search string with the
  468. replacement string without pause.  In the second, EMACS pauses at
  469. every search string found and prompts you for an action command which
  470. allows you to control exactly which occurrences of the search string
  471. will be replaced.  Because of the lack of control over the regular
  472. replace, it is strongly recommended that you be very sure of your
  473. changes before you use it.  In general, the query replace command
  474. should be used.  Procedurally, replacing strings with other strings
  475. (including the null string) is done as follows: first you are prompted
  476. for the search string and then for the replacement string.  EMACS then
  477. moves from the current position to the end of the buffer replacing (or
  478. querying) as it goes along.  Note that there is no control over the
  479. direction of the replacement -- EMACS always moves foward.  Hence, to
  480. work on the entire buffer, you need first to move to the top of the
  481. buffer and issue the replace command. 
  482. @begin(description)
  483.  
  484. CTRL-S@/Search-Forward.  Search for input string (stored string if
  485. input string is null) from point towards the end of the buffer.  The
  486. point is moved from the current location to the end of the found string.
  487.  
  488. CTRL-R@/Search-Backward.  Like forward except in the opposite direction
  489. i.e., towards the beginning of the buffer.  Note that there is no
  490. distinction made between forward and backward stored search strings.  Finally
  491. if the search string is found, the point is moved to the beginning of
  492. the string.
  493.  
  494. ESC R@/Replace.  Replace @i<ALL> occurrences of the search string with
  495. the null string from point to end-of-buffer.
  496.  
  497. ESC CTRL-R@/Query-Replace.  Like above, but pause at each search
  498. string found and query for action.
  499. The response expected from you and their effects are as follows:
  500. @begin(description)
  501. Y(es) or <space>@/Make this replacement
  502.  
  503. N(o)@/Do not make this replacement but continue
  504.  
  505. !@/Do the rest of the replacements with no queries
  506.  
  507. CTRL-G@/Abort the replacement command.  NOTE:  This does not
  508. undo any previous replacement that you had authorized.
  509.  
  510. .@/Exactly like CTRL-G except that the cursor returns to
  511. the point at which the replacement command was given.
  512.  
  513. ?@/Help for query replacement
  514. @end(description)
  515. @end(description) 
  516.  
  517. @chapter(DEALING WITH WINDOWS)
  518.  
  519. @tag(windows)First of all, note that windows are literally that: they are
  520. areas of text in a buffer that you can see on the screen.  On the other hand,
  521. by moving between windows and visiting different buffers in each, you
  522. can effectively edit several files at the same time.  When you ask for
  523. additional windows, EMACS splits the @i<current> window into two and
  524. leaves you in the window created over the current pointer.  Thus you
  525. can get multiple windows on the screen.  What is less obvious is that
  526. you are always in a window which means that all window commands
  527. operate even when you are in a single window.  Each window is similar
  528. in that it has a text area and the mode line.  However the
  529. information/prompt line is common to all windows (and buffers). 
  530. Further the new window will be into the same buffer as the one from
  531. which the create window command was given.  To move the window to
  532. another buffer, you will have to "visit" the desired buffer from the
  533. desired window.  Since files are associated with buffers, this lets
  534. you simultaneously edit several files.  Which leads us to the final
  535. point: all commands issued to EMACS are executed on the current buffer
  536. in the current window.
  537. @begin(description)
  538.  
  539. CTRL-X O(oh)@/To-Next-Window.  The current point is moved into the next
  540. (i.e., towards the end of the screen) window.  Note that the editor
  541. cycles through windows which means that if the command is issued from
  542. the bottommost window you are put into the top window.
  543.  
  544. CTRL-XP@/To-Previous-Window.  Like above but works on the previous
  545. window. 
  546.  
  547. CTRL-X 2@/Open-Window.  The current window is split into two
  548. windows -- @i<IF> there is enough space on the screen (a minimum of 1
  549. line of text and 1 mode line per window are required).
  550.  
  551. CTRL-X 1@/Close-Windows.  This closes @i<all> windows except the one
  552. from which you issued the command.
  553.  
  554. CTRL-X CTRL-N@/Scroll-Current-Window-Down.  This scrolls the current
  555. window down one line; i.e., the top line of the window dissappears and
  556. the hitherto invisible "next" line becomes visible.  Hence the scroll
  557. window commands work counter-intuitively in that ordinarily one moves
  558. ones head with a "real" window or one moves the paper while here one
  559. is literally moving the window on to the buffer.
  560.  
  561. CTRL-X CTRL-P@/Scroll-Current-Window-Up.  Like above except in the
  562. opposite direction; i.e., the previously invisible line towards the
  563. beginning of the buffer is made visible and the bottom line
  564. dissappears from the window. 
  565.  
  566. ECS ! or ESC CTRL-L@/Center-Cursor.  The window is moved such that the
  567. line with the point (with the cursor) is at the center of the window.
  568.  
  569. CTRL-X ^ or CTRL-X Z@/Enlarge-Window.  The window with the
  570. pointer is enlarged by one line and the nearest window is shrunk by
  571. one line.
  572.  
  573. CTRL-X CTRL-Z@/Shrink-Window.  Like above but the current
  574. window is shrunk and the nearest window is enlarged.
  575.  
  576. CTRL-L@/Refresh-Screen.  The screen is blanked and redrawn.  Useful if
  577. the screen updates are out of sync with your  commands.
  578. @end(description) 
  579.  
  580. @comment(chapter9to12)
  581. @chapter<DEALING WITH BUFFERS>@tag(buffers)
  582.  
  583.      Buffers are the major internal entities in EMACS and are
  584. characterized by three things: their names, their modes, and the
  585. file with which they are associated.  Furthermore, each buffer has its
  586. own remembered mark and point which makes it easy to "visit" other
  587. buffers and return to the original location  in the "current" buffer.
  588. Dealing with them requires the following commands:
  589.  
  590. @begin(description)
  591. ESC < or <HOME>@/Top-Of-Buffer.  Moves point to the very beginning of
  592. the buffer.
  593.  
  594. ESC >or <shift-HOME>@/Bottom-Of-Buffer.  Moves point to the very end of the buffer.
  595.  
  596. ESC B@/To-Named-Buffer.  You will be prompted for a buffer name (see
  597. @ref(buflist) on how to find out about your buffers) and will be
  598. switched to it.  If the buffer does not exits, EMACS will create one
  599. and put you into it.
  600.  
  601. CTRL-X X@/Next-Buffer.  You will be put into the next buffer
  602. in the buffer list.  Like with windows, EMACS cycles through the
  603. buffer list and hence if you are in the last buffer, you will be put
  604. into the first one.
  605.  
  606. CTRL-X CTRL-B@/List-Buffers.  A new window is created into the "List"
  607. buffer which contains details about all the buffers currently known to EMACS.
  608. You are left in the original buffer.  To close the new window issue
  609. the close-windows command (CTRL-X 1).  The "List" buffer contains
  610. information about the set global modes, the "buffer changed" indicator
  611. (an asterisk in the 2nd column), the buffer specific modes, the
  612. buffer size, the buffer name, and the associated filename.
  613.  
  614.  
  615. CTRL-X K@/Delete-Buffer.  The specified buffer (as above) is
  616. deleted if found.  Since this is a destructive operation, you will
  617. asked for confirmation if the buffer was changed and not saved. 
  618. Answer Y(es) or N(o).  As usual, CTRL-G cancels the command.
  619. @end(description)
  620.  
  621. @section(Modes) @tag(modes)
  622.      Modes are associated with buffers and govern the way EMACS reacts
  623. to certain commands (to be described below).  Each buffer starts with
  624. no modes set and this is indicated on the information line in parentheses
  625. However, you can set "global" modes which means that each new buffer
  626. starts off in the set global modes.  Alternatively, you can add and
  627. delete modes for each buffer separately.
  628.  
  629. Currently, EMACS has the following modes: normal, wrap, view,
  630. overwrite, exact, and C.  Note that the default for all buffers is to
  631. be placed with no modes unless global modes are set.
  632. In this normal case, long lines are not folded
  633. and the line shifts to the left to enable you to view lines longer
  634. than 79 characters.  A dollar sign in the last column indicates a line
  635. that is longer than 79 characters.  Furthermore, any text typed after
  636. the 79th character is inserted exactly as is thus enabling you to
  637. enter very long lines into your buffer.  Also no other modes are set
  638. and hence you have no wrapping, insert mode, and inexact match. 
  639. @begin(description)
  640.  
  641. Wrap@/When wrap mode is set, EMACS tries to fold (break) lines at
  642. the currently defined right margin. See @tag(wrap) for more details on
  643. wrapping text.
  644.  
  645. View@/View mode essentially puts
  646. you into a read only buffer to prevent accidental damage to
  647. files.  Some special files, such as the help file, are automatically
  648. put into view mode buffer.@tag(viewmode)
  649.  
  650. Over@/In over(write) mode, the normal "insert" mode is toggled off
  651. which means anything you type in that would normally have
  652. inserted itself would now overwrite the existing text.  The
  653. Insert-Space command (currently bound to CTRL-C) is very useful in
  654. this mode since it is self-inserting.@tag(insertmode)
  655.  
  656. Exact@/The exact mode
  657. controls the manner in which string searches are done:  if exact mode
  658. is set, the search is case sensitive;  if it is off, the case of the
  659. target is ignored.
  660. C@/This mode is
  661. automatically set if the file extension is .c or .h and does useful
  662. things for you when you are writing programs in C.
  663. @end(description)
  664.  
  665.  
  666. The commands required to deal with modes are as follows:
  667.  
  668. @begin(description)
  669. CTRL-X M@/Add-Mode.  You will be prompted for the mode to add.  Type it
  670. in and hit return.  The mode line will change to reflect the addition.
  671. As always, CTRL-G gets you out.  NOTE: To set the right margin when in wrap
  672. mode, use the set right margin command with the appropriate numerical prefix
  673. argument with ESC <number> CTRL-X F.  Thus, for example, to set the right
  674. margin at column 68 you would type:  ESC 68 CTRL-X F.  (See @ref<setmargin>).
  675.  
  676. CTRL-X CTRL-M@/Delete-Mode.  Like above but to remove a mode for the current
  677. buffer.
  678.  
  679. ESC M@/Add-Global-Mode.  The specified global mode is marked as to-be-added
  680. to any new buffer.  Hence, the modes for existing buffers do not
  681. change.@tag(globalmode)
  682.  
  683. ESC CTRL-M@/Delete-Global-Mode.  The specified global mode is removed
  684. from the modes to be added to new buffers.   Once again, existing
  685. buffers and their modes are not effected.
  686. @end(description)
  687.  
  688. @chapter(DEALING WITH FILES)
  689. Text files are usually thought of as named collections of text
  690. residing on disk (or some other storage medium).  In EMACS the disk
  691. based versions of files come into play only when reading into or
  692. writing out buffers.  The link between the physical file and the
  693. buffer is through the associated filename.  EMACS permits full filenames;
  694. i.e., you can specify: disk:\directories\filename.extension.  If the
  695. disk and directories are not specified, the default disk is used. 
  696. Because of the way EMACS deals with files, several points ought to be noted.
  697. First, without explicitly saving the buffer into a files, all your
  698. edits would be gone upon leaving EMACS (you are asked to confirm
  699. whenever you are about to lose edits).  Second, EMACS (at least currently)
  700. has no mechanism for "protecting" your diskbased files from
  701. overwriting when it saves files.  When instructed to save a file, it
  702. merrily proceeds to dump the file to disk.  If it didn't previously
  703. exist it is now created.  If it did, it is overwritten and the
  704. previous version is lost for ever.  Hence, if you are unsure of your
  705. edits or for any other reason wish to keep older versions of files around,
  706. the safe procedure is to read the file into a buffer (with CTRL-X R),
  707. immediately change the associated file name (with CTRL-X N), and then
  708. start your edits.  However, if you do not wish to do any edits but
  709. merely peruse the file, add the view mode (see @ref(viewmode)) to the
  710. buffer or ask for the file to be read in for viewing only (with CTRL-X V).
  711. The following are the file related commands in EMACS.
  712. @begin(description)
  713.  
  714. CTRL-X CTRL-S@/SAve-Buffer-Under-Current-Filename.  Saves the contents
  715. of the current buffer with the associated filename on the default disk/directory
  716. (if not specified).  Note that  CTRL-X S also works.
  717.  
  718. CTRL-X CTRL-W@/Save-Buffer-Under-New-Name.  You will be prompted for a
  719. file name.  Type it in and hit <return>.   The buffer contents will be
  720. saved under the given name.
  721.  
  722. CTRL-X N@/Change-Associated-Filename.  The associated filename is
  723. changed (or associated if not previously specified) as specified.
  724.  
  725. CTRL-X CTRL-F@/Find-A-File.  You will be prompted for a filename.  If the file has already been read into a buffer,
  726. you will be switch to it.  If not, it will be read into a new buffer and you
  727. will be put into that buffer.
  728.  
  729. CTRL-X CTRL-R@/Read-In-A-File.  You will be prompted for a filename.  If the
  730. file has already been read into another buffer,  you will be switched to it.
  731. If not,  it will be read into the CURRENT buffer thus overwriting the
  732. buffer contents.  As always, you will be asked for confirmation of the
  733. overwrite if the buffer has been changed since the last save.
  734.  
  735. CTRL-X CTRL-V@/View-A-File.  Exactly like the above except that the
  736. buffer will automatically be put into view mode thus not allowing you
  737. to make any changes to it. 
  738. @end(description)
  739. @chapter(FORMATTING)
  740.  
  741.      While, as said before, EMACS is not a word-processor, some
  742. formatting facilities are available. In no particular order they
  743. are:
  744.  
  745. @section(WRAPPING TEXT)
  746.  
  747.     Normally, EMACS allows you to type in long lines (longer than
  748. the screen width). However, if you wish it to automatically wrap
  749. lines longer than a given width, you can do so by setting the
  750. @tag(setmargin)
  751. WRAP mode.
  752. @begin(description) 
  753. CTRL-X M [WRAP]@/Add-Wrap-Mode.  Add wrap mode to current buffer. 
  754. Note that [WRAP] means that you respong with WRAP when prompted.
  755.  
  756. CTRL-X CTRL-M [WRAP]@/Delete-Wrap-Mode.  Removes wrap mode from
  757. current buffer.
  758. @end(description)
  759.  
  760. Wrap mode does not set the column (margin) at which wrapping is
  761. supposed to occur.  Hence, it is very important that along with
  762. adding wrap mode to the buffer, you set the desired margin.  If you don't,
  763. the usual default value of 1 is used and the editor will behave very
  764. strangely since any text beyond the first column will be wrapped.
  765.  
  766. @begin(description)
  767. CTRL-X F@/Set-Wrap-Margin.  Sets the wrap margin to the given numeric argument
  768. If you do not precede this command with a numeric argument (with ESC <number>),
  769. the right margin is set at column 1 which is the default numeric argument. 
  770. @end(description)
  771.  
  772. When in wrap mode, you can re-format a paragraph after extensive
  773. editing as follows:
  774. @begin<description>
  775. ESC Q@/Fill-Current-Paragraph.  See @ref(paradef) for a discussion of
  776. what is considered to be a paragraph in EMACS.
  777. @end(description) 
  778. @section(Changing Case)
  779. Changing the case of the text in EMACS is also easy:
  780.  
  781. @begin(description) 
  782. ESC U@/Upper-Case-Word.  The text from point to the end of the word is
  783. changed to all uppercase.
  784.  
  785. ESC L@/Lower-Case-Word.  Like above except that text is changed to
  786. lower case.
  787.  
  788. ESC C@/Capitalize-Word.  The first word after point is capitalized 
  789. (that is the first letter only is uppercased).  This means that if you
  790. issued the command from within a word, the character after point is
  791. capitalized resulting in some wierd looking text.
  792.  
  793. ESC CTRL-U@/Upper-Case-Region.  All of the text between point and mark (i.e.
  794. in the region) is capitalized.
  795.  
  796. ESC CTRL-L@/Lower-Case-Region.  All of the text in the region (between
  797. point and mark) is lower-cased.
  798. @end(description) 
  799. @section(Miscellaneous)
  800. @tag(tabset)
  801. Setting tabs to arbitray widths is possible in EMACS but you must be
  802. aware of a subtle difference that it makes to your file and hence to
  803. your editing.  When you start EMACS, the tab width is set to the
  804. default (usually every 8th column) for the tab character (CTRL-I).  As
  805. long as you stay with the default, every time you insert the tab
  806. character, a CTRL-I get inserted.  Hence, you logically have a single
  807. character which might appear to be several spaces on the screen (or
  808. the output) depending upon the column location of the tab character. 
  809. This means that to remove the spacing you have to delete a @i<single>
  810. character -- the tab character.
  811.  
  812. On the other hand, the moment you explicitly set the tab interval
  813. (even if it is to the default value), EMACS handles the tab character
  814. by expanding the character into the required number of spaces to move
  815. you to the appropriate column.   In this case, to remove the spacing
  816. you have to delete the appropriate number of spaces inserted by EMACS
  817. to get you to the right column.
  818.  
  819. @begin(description)
  820. CTRL-I@/Set-Tab-Interval.  The tab interval is set to the given
  821. numeric argument.  As always, the numeric argument preceeds the
  822. command.  Hence to get tabs every 4 spaces you would type in@*
  823. @center[    ESC 4 CTRL-I]@*
  824. or more generally: ESC [number] CTRL-I.
  825. @end(description)
  826. @chapter(GETTING OUT OF THINGS)
  827.  
  828.     Any pending commands can be aborted with CTRL-G. All this
  829. does is cancel the command at its current level. Hence, for
  830. example, part of the way through a query replace, the abort will
  831. not undo the changes you have already allowed but will cancel the
  832. remainder.
  833.  
  834.    Getting out of EMACS itself is possible in several ways:
  835. @begin(description) 
  836.  
  837. CTRL-X CTRL-C.@/Hard-Abort.  This gets you out of EMACS and back to DOS.
  838. However if there are changed buffers which have not been
  839. saved, you  will be queried.
  840.  
  841. ESC Z@/Quick-Exit.  This gets you out of EMACS but only @i<after> all
  842. changed buffers with legal filenames have been saved under the current
  843. associated filenames. Hence this could be a very dangerous command if
  844. there are changed buffers which will overwrite files you wished left
  845. unchanged.  In general avoid this command. 
  846. @end(description)
  847.  
  848. ***********************************************************
  849. ***                  W A R N I N G                      ***
  850. ***                                                     ***
  851. *** AGAIN, PLEASE NOTE THAT ALL CHANGED BUFFERS WITH    ***
  852. *** FILENAMES WILL AUTOMATICALLY BE SAVED WITH ESC Z    ***
  853. ***********************************************************
  854.  
  855. @comment(ch13 to 16) 
  856. @chapter(Keyboard Macros)@tag(kbdmacro)
  857.  
  858.      A keyboard macro is a short hand way to repeat a series of
  859. commands.  In effect, a "recording" is started, with CTRL-X (,  of the
  860. sequence of keys that you hit when defining a keyboard macro.  The
  861. recording is then repeated when you execute the keyboard macro. 
  862. Hence, you could record any combination of character input and
  863. commands you like.  Once you stop recording your keystrokes(with
  864. CTRL-X ) ), the entire sequence is available to you to be repeated
  865. starting at the point at which the keyboard macro is invoked.  You
  866. could, therefore start recording at some location, move to another
  867. point, and repeat the entire sequence at that location by invoking the
  868. recorded macro (with CTRL-X E). Since it is keystrokes that are being
  869. saved, you can freely intermix commands and text to be inserted  into
  870. the buffer.  Unfortunately, you cannot save a keyborad macro for
  871. later.  If you start another keyboard macro recording session, the previously
  872. defined macro is lost.  So make sure that you are done with the
  873. current keyboard macro before defining another one.  If you have a
  874. series of commands that you would like to "record" for later use, use
  875. the execute-file or execute-buffer commands (see @ref(execbuf) and/or 
  876. @ref(execfile)).
  877. @begin(description)
  878.  
  879. CTRL-X (@/Start-Recording.  @b(All) keystrokes, commands and input are 
  880. recorded till the end-recording command is given.
  881.  
  882. CTRL-X )@/End-Recording.    Stop recording keystrokes for macro.
  883. CTRL-X e@/Execute-Macro.  The entire sequence of recorded keystrokes
  884. is repeated starting at the current point.  The result is exactly as if you 
  885. we retyping the sequence all over again.  A numeric argument prefixing
  886. the Execute-Macro command repeats the stored keystrokes that many times.
  887. @end(description) 
  888.  
  889. @chapter(Msdos And Emacs)@tag(msdos)
  890.  
  891.     There are two commands which will allow you to use MSDOS
  892. while within EMACS. Procedurally, you will need to make sure that
  893. the "current" directory contains COMMAND.COM before you issue any
  894. internal commands (see the MSDOS manual). Also, external commands
  895. or program may be run with some restrictions depending upon the
  896. degree to which the program "takes over" the computer or the amount of
  897. memory you have and the program size.  When you
  898. use either of the commands, EMACS pops you into MSDOS.  The key
  899. difference between the two commands is in how they act after the first
  900. MSDOS command has finished executing.  If you use the Run-DOS-Command command
  901. a <RETURN> will put you back in EMACS exactly as you were before. 
  902. The Run-CLI (run the Command Line Interpretor), on the other hand,
  903. leaves you at the DOS command level (usually the A> prompt) so that
  904. you can continue issuing other commands; to return to EMACS, you need
  905. to type in EXIT to leave the command line interpretor.
  906. NOTE: since EMACS is callable from the command line, you could easily have
  907. several EMACS images in memory!  In general, this is a practice to be avoided
  908.  
  909. @begin(description)
  910.  
  911. CTRL-X !@/Run-DOS-Command.  Suspends EMACS and, if the file COMMAND.COM is
  912. on the default drive,  allows one DOS command to be executed.  After
  913. finishing with that command, a <RETURN> will put you back in EMACS.
  914.  
  915. CTRL-X C@/Run-CLI.  Like above execpt that multiple commands are
  916. permitted.  To return to EMACS, type in EXIT at the DOS prompt.
  917. @end(description)
  918.  
  919. SUGGESTION: If you are going to run a program (or external MSDOS
  920. command) from within EMACS for the first time, save your changed
  921. buffers (if you so desire) before you start. Once you are sure
  922. that the program will not damage EMACS, you need not take such
  923. precautions. As a favor to the user community, please inform the
  924. Computing Center of program that do and do not work and we will
  925. try to disseminate the information.
  926.  
  927. PROGRAMS AND EXTERNAL COMMANDS TESTED SO FAR: 
  928. XDIR@*
  929. PRINT@*
  930. KERMIT@*
  931. FINALWORD@*
  932. ALL "INTERNAL" COMMANDS@*
  933.  
  934. @chapter(Unbound Commands)
  935. In this chapter we mention several commands that are not currently
  936. bound to any keys.  If you find that you are using some of these
  937. consistently, you might want to bind them yourself either permanently
  938. or temporarily (see @ref(customization)).
  939.  
  940. To execute an unbound (or for that matter a bound command) use the
  941. command: Execute-Named-Command which is currently bound to ESC-X.
  942. @description[
  943. ESC-X@/Execute-Named-Command.  You will be prompted (with a colon) on
  944. the prompt line for the named command to be executed.  Appendix A
  945. contains a list of the named comands that you could execute.  EMACS
  946. attempts to complete the command if you hit the <SPACE> bar; i.e., if
  947. the information that you have typed in so far is sufficient to
  948. identify the command uniquely, EMACS finishes typing it in for you and
  949. then waits for the <RETURN> before executing the command.]
  950.  
  951. Unbound commands are:
  952. @begin(description)
  953. Hunt-Forward@/Repeat the last forward search command. Thus this is
  954. identical to you typing in CTRL-S (search-forward) and then defaulting
  955. the search string (by simply giving an ESC at the prompt line).
  956.  
  957. Hunt-Backward@/Repeat the last reverse search command. Thus this is
  958. identical to you typing in CTRL-R (search-reverse) and then defaulting
  959. the search string (by simply giving an ESC at the prompt line).
  960.  
  961. Execute-Buffer@/You will be prompted for a buffer name.  If the buffer
  962. exists, EMACS will assume that its contents are commands to be
  963. executed by it before returning control to you.  If any of the
  964. commands are incorrect in the buffer, EMACS aborts the command and
  965. returns control to you immediately.  The syntax of commands in the
  966. buffer is as follows:@*
  967.     [numeric argument] named-command [string argument] [string argument]@*
  968. where the only required parameter is the named-command itself.@tag(execbuf)
  969.  
  970. Execute-File@/Very similar to the Execute-Buffer command except that
  971. you will be prompted for a file containing commands to be executed by
  972. EMACS. As in the above case, error will cause an immediate abort and
  973. the syntax of the commands is the same.@tag(execfile)
  974.  
  975. Execute-Command-Line@/????
  976. @end(description)
  977. @chapter(Customization)
  978. @tag(customization)
  979. EMACS is extensively customizable in that the keystroke used to invoke
  980. a command can be changed to suit your needs at will.  The connection
  981. of a keystroke to a command is called key-binding.  Keybinding can be
  982. done temporarily or permanently -- by which we mean that the changed
  983. keybinding will last only during one editing session or will always be
  984. effective.  Furthermore, any keybinding can be removed permanently or during
  985. an editing session.  We will cover temporary bindings and unbindings first.  
  986.  
  987. @begin(description)
  988. ESC K@/Bind-To-Key.  The Bind-To-Key command, currently bound to ESC
  989. K, will prompt you for the named command and the key to which it is to
  990. be bound.  The set of named commands is in Appendix A.  The key(s) to
  991. which the command is to be bound are simply typed in exactly.  That
  992. is, to bind a command to, say ESC D, type in the named command, a
  993. space, and then the keys ESC and D.
  994.  
  995. ESC CTRL-K@/Unbind-Key.  This command undoes the effect of the
  996. previous command or any built-in bindings.  As above you will be
  997. prompted for the required information -- in this case the information
  998. is simply the key to be unbound which is to be typed in exactly as
  999. above.
  1000. @end(description)
  1001. @i<@b[
  1002. NOTE:  be very careful in binding and unbinding keys since you could
  1003. get into some very peculiar situations such as being unable to abort
  1004. our of a command (if you unbind CTRL-G or bind it to something else)
  1005. or recover from the bad binding/unbinding if you unbind Execute-Named-Command
  1006. or the Unbind-Key command.  As long as you leave yourself the
  1007. opportunity to do either of the last two commands, youc an recover
  1008. from disasterous bindings/unbindings.]>
  1009.  
  1010. Permanent changes are done indirectly through the EMACS.RC file.  This
  1011. is a file that EMACS reads and executes (see @ref(execfile))
  1012. @i<before> startup and hence results in the appearance of a permanent
  1013. change in the keybindings.  The syntax of commands in the EMACS.RC
  1014. file is described under the Execute-File command (@ref(execfile)).  Of
  1015. principal concern here are the two commands Bind-To-Key and
  1016. Unbind-Key.  The primary difference between the way parameters are
  1017. passed to these commands in the EMACS.RC file is that the keys are not
  1018. typed in directly (as in the control-I key when you want CTRL-I) but
  1019. symbolically using the following symbols:
  1020.  
  1021. @description[
  1022.  
  1023. ^@/for control keys. For example to indicate control-I, you would type ^I.
  1024.  
  1025. M@/for the escape key.  For example, to indicate ESC CTRL-K, you would
  1026. type in M^I.
  1027.  
  1028. FN@/for "function" keys.  The reason for the quotes is that for the
  1029. HP150 the term function is expanded to include all of the special keys
  1030. such as the <INSERT-CHAR> key.  
  1031. ]
  1032.